package com.jt.demo52.SpringAop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Order(1)
public class SpringAop2 {
      //@Autowired
     // @Pointcut("bean(userServiceImpl)")
//    @Pointcut("bean(UserServiceImpl)")
//    public void as(){
//    }

    @Pointcut("bean(userServiceImpl)")
    public void Amazed(){
    }
    @Around(value = "Amazed()")
    public Object ds(ProceedingJoinPoint point) throws Throwable {
        System.out.println("环绕2");
        Object proceed = point.proceed();
        System.out.println("环绕2");
            return  proceed;
    }

}
